#include "NCurses.h"

// Initialize static member variables: 
bool NCurses::isInitialized = false;

NCurses::NCurses()
{
}

NCurses::~NCurses()
{
}

void NCurses::init(bool raw, bool echo, bool keypad)
{
    if (! isInitialized)
    {
        initscr();
        
        if (raw)
            cbreak();
        
        if (! echo)
            noecho();
            
        isInitialized = true;
        refresh();
    }
}

void NCurses::end()
{
    endwin();
    isInitialized = false;
}

bool NCurses::initialized()
{
    return isInitialized;
}
